package com.study.spmongodb.thread;

/**
 * @author study
 * @version 1.0
 * @date 2020/10/13 14:21
 */
public class Demo {
    public static void main(String[] args) {
        System.out.println("线程");
        new Thread().start();
    }

    class Demo1 extends Thread {
        @Override
        public void run() {

            final String name = Thread.currentThread().getName();
            for (int i = 0; i < 5; i++) {
                System.out.println(name + " " + i);

            }
        }
    }

    class DemoRunnable implements Runnable {
        @Override
        public void run() {
            System.out.println(Thread.currentThread().getName());
        }
    }
    /**
     * 线程停止
     * 1 设置退出标志，是线程正常退出
     * 2 使用interrupt方法中断线程
     */

}
